#include "GameLib/Framework.h"
#include "FileUtils.h"
#include "Stage.h"

#include <iostream>

Stage* stage = nullptr;

namespace GameLib
{
    void Framework::update()
    {
        if(!stage)
        {
            char* mapData = nullptr;
            size_t size = 0;
            FileUtils::LoadFile("../res/map.txt", &mapData, &size);

            stage = new Stage(mapData, size);
            stage->draw();

            return;
        }

        char input;
        std::cin >> input;
        stage->update(input);
        stage->draw();
    }
}